<template>
  <PCard class="tc-con" :isCardBorder="false" :shadow="'never'" :isHeadBottomBorder="true"
    :bodyStyle="{ width: '100%' }">


    <PCard class="tc-item-con" :isCardBorder="false" :shadow="'never'" :isHeadBottomBorder="true"
      :bodyStyle="{ width: '100%' }">
      <div slot="header" class="tc-title">
        <span>邮寄资料</span>
      </div>
      <div class="tc-item-body1">
        <div class="body-item" >
          领取方式：{{MIConfig.onLine}}
        </div>
      </div>
      <div class="tc-item-body1">
        <div class="body-item" >
          领取资料如下：
        </div>
      </div>
      <div class="tc-item-body1">
        <div class="body-item" v-if="dataList.yyzz">
          <a-tag color="pink">
            营业执照(正副本)
          </a-tag>
        </div>
        <div class="body-item"  v-if="dataList.gz">
          <a-tag color="pink">
            公司业务公章（公章、财务章等）
          </a-tag>
        </div>
        <div class="body-item"  v-if="dataList.yhzl">
          <a-tag color="pink">
             银行相关资料
          </a-tag>
        </div>
      </div>
    </PCard>

    <PCard class="tc-item-con" v-if="MIConfig.onLine=='快递寄送'" :isCardBorder="false" :shadow="'never'" :isHeadBottomBorder="true"
      :bodyStyle="{ width: '100%' }">
      <div slot="header" class="tc-title">
        <span>邮寄地址</span>
      </div>
      <div class="tc-item-body">
        <div class="body-item">
          <div class="label">收件人：</div>
          <div class="value">{{MIConfig.consignee}}</div>
        </div>
        <div class="body-item">
          <div class="label">收件电话：</div>
          <div class="value">{{MIConfig.phone}}</div>
        </div>
        <div class="body-item">
          <div class="label">收件地址：</div>
          <div class="value">{{MIConfig.address}}</div>
        </div>
        <div class="body-item">
          <div class="label">备注：</div>
          <div class="value">{{MIConfig.remark}}</div>
        </div>
      </div>
    </PCard>


  </PCard>
</template>

<script>
export default {
  name: 'sipiMailingInformation',
  props: {
    pageInfo: { type: Object }
  },
  data(){
    return {
      dataList:{
        yyzz:true, // 营业执照
        gz:false, // 公章
        yhzl:false, // 银行资料
      },
      MIConfig:{
        onLine:'',
        consignee:'',
        phone:'',
        address:'',
        remark:'',
      }
    }
  },
  watch: {
    pageInfo: {
      handler(val) {
        if (Object.prototype.toString.call(val) === '[object Object]') {
          const { pageData, dbData } = val
          if(dbData){
            this.MIConfig.consignee = dbData.consignee || '--'
            this.MIConfig.phone = dbData.phone || '--'
            this.MIConfig.address = dbData.address || '--'
            this.MIConfig.remark = dbData.remark || '--'
            // 快递寄送  线下领取
            this.MIConfig.onLine = {0:'快递寄送',1:'线下领取','-1':'--'}[dbData.onLine]
            this.dataList.yyzz = {0:false,1:true,'-1':false}[dbData.businessLicense||'-1']
            this.dataList.gz = {0:false,1:true,'-1':false}[dbData.seal||'-1']
            this.dataList.yhzl = {0:false,1:true,'-1':false}[dbData.applicationForApproval||'-1']

          }
          this.entId = pageData.entId
        }
      },
      deep: true,
      immediate: true
    },
  },
}
</script>


<style lang="less">
.tc-con {
  .card-body {
    padding: 0;
  }

  .tc-item-con {
    .card-body {
      padding: 20px;
    }

    .tc-title {
      font-size: 20px;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #333333;
      display: flex;
      justify-content: space-between;
      align-items: center;

      .data-label {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        font-size: 14px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #666666;

        .value {
          color: #FF6A6A;
        }
      }
    }

    .tc-item-body1 {
      width: 100%;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      margin: 10px 0;
      .body-item {
        padding: 5px 10px;
      }
    }

    .tc-item-body {
      width: 100%;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      flex-direction: column;

      .body-item {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        line-height: 40px;

        .label {
          font-size: 14px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #666666;
        }

        .value {
          font-size: 14px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #333333;
        }
      }
    }
  }

}
</style>
